function uploadVideo(){
  var me = this;
  wx.chooseVideo({
    sourceType: ['album', 'camera'],
    success:function(res){
      console.log(res)
      
      var duration = res.duration;
      var tmpHeight = res.height;
      var tmpWidth = res.width;
      var tmpVideoUrl = res.tempFilePath;
      var tmpCoverUrl = res.thumbTempFilePath;
      
      if(duration > 16 ){
        wx.showToast({
          title: '上传视频长度不能超过15秒',
          icon: 'none',
          duration: 3000
        })
      }
      else if(duration < 5){
        wx.showToast({
          title: '上传视频长度不能小于5秒',
          icon: 'none',
          duration: 3000
        })
      }
      else{
        // 打开选择bgm页面
        wx.navigateTo({
          url: '../chooseBgm/chooseBgm?duration='+ duration +
          '&tmpHeight=' + tmpHeight +
        '&tmpWidth=' + tmpWidth +
        '&tmpVideoUrl=' + tmpVideoUrl +
        '&tmpCoverUrl=' + tmpCoverUrl,
      })
    }
  }
  })
}

module.exports = {
  uploadVideo: uploadVideo
}